<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>五子棋 - 用户认证</title>
    <link href="./css/bootstrap.min.css" rel="stylesheet">
    <link href="./css/style.css" rel="stylesheet">
</head>
<body class="auth-body">
    <div class="auth-container">
        <div class="auth-card">
            <h2 class="text-center mb-4">用户登录/注册</h2>
            
            <div class="auth-tabs">
                <ul class="nav nav-tabs" id="authTab">
                    <li class="nav-item">
                        <a class="nav-link active" id="login-tab" data-bs-toggle="tab" href="#login">登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="register-tab" data-bs-toggle="tab" href="#register">注册</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="guest-tab" data-bs-toggle="tab" href="#guest">游客模式</a>
                    </li>
                </ul>
                
                <div class="tab-content p-3">
                    <!-- 登录表单 -->
                    <div class="tab-pane fade show active" id="login">
                        <form id="loginForm">
                            <div class="mb-3">
                                <label for="loginUsername" class="form-label">用户名</label>
                                <input type="text" class="form-control" id="loginUsername" required>
                            </div>
                            <div class="mb-3">
                                <label for="loginPassword" class="form-label">密码</label>
                                <input type="password" class="form-control" id="loginPassword" required>
                            </div>
                            <button type="submit" class="btn btn-primary w-100">登录</button>
                        </form>
                    </div>
                    
                    <!-- 注册表单 -->
                    <div class="tab-pane fade" id="register">
                        <form id="registerForm">
                            <div class="mb-3">
                                <label for="registerUsername" class="form-label">用户名</label>
                                <input type="text" class="form-control" id="registerUsername" required minlength="3">
                            </div>
                            <div class="mb-3">
                                <label for="registerPassword" class="form-label">密码</label>
                                <input type="password" class="form-control" id="registerPassword" required minlength="6">
                            </div>
                            <div class="mb-3">
                                <label for="registerConfirm" class="form-label">确认密码</label>
                                <input type="password" class="form-control" id="registerConfirm" required>
                            </div>
                            <button type="submit" class="btn btn-success w-100">注册</button>
                        </form>
                    </div>
                    
                    <!-- 游客模式 -->
                    <div class="tab-pane fade" id="guest">
                        <div class="alert alert-info">
                            <p>游客模式将为您生成临时账号，数据仅保存在当前浏览器中。</p>
                            <p class="mb-0">关闭浏览器后数据可能丢失。</p>
                        </div>
                        <button id="guestLogin" class="btn btn-outline-primary w-100">进入游客模式</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="./js/bootstrap/bootstrap.bundle.min.js"></script>
    <script src="./js/auth.js"></script>
</body>
</html>